//
//  SearchMedicineCell.swift
//  TCMHealth
//
//  Created by 刘占雨 on 2023/7/17.
//

import UIKit

class SearchMedicineCell: UITableViewCell {

    @IBOutlet weak var medicineNameLabel: UILabel!
    @IBOutlet weak var medicineDesLabel: UILabel!
    var medicineName: String {
        set {
            if newValue.components(separatedBy: ",")[1].count > 0{
                medicineNameLabel.text = (newValue.components(separatedBy: ",").first ?? "") + "-" + newValue.components(separatedBy: ",")[1]
            }else {
                medicineNameLabel.text = newValue.components(separatedBy: ",").first ?? ""
            }
            
            medicineDesLabel.text = newValue.components(separatedBy: ",").last
        }
        
        get {
            return self.medicineName
        }
    }
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
